package A1_4;

import java.time.LocalDate;

public class Main {
    public static void main(String[] args) {
        // 创建商品
        Product product1 = new Product("Laptop", 2.5, "A high-performance laptop", 1200.0);
        Product product2 = new Product("Mouse", 0.1, "A wireless mouse", 30.0);

        // 创建客户
        Customer customer = new Customer("John Doe", "1234567890", "123 Street Name, City", true);

        // 创建订单和支付
        LocalDate today = LocalDate.now();
        Payment payment = new Credit("1234567890123456", "Visa", today.plusYears(1), 1250.0);
        Order order = new Order(today, payment);

        // 添加订单详情
        order.addDetail(new OrderDetail(product1, 1));
        order.addDetail(new OrderDetail(product2, 1));

        // 打印订单信息
        System.out.println("Order Date: " + order.getCreateDate());
        System.out.println("Order Status: " + order.getStatus());
        System.out.println("Total Amount: " + order.getTotalAmount());
        System.out.println("Total Weight: " + order.getTotalWeight() + " kg");
    }
}
